perm filename A10.TEX[106,PHY] blob sn#807713 filedate 1985-09-20 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	\magnification\magstephalf
C00006 ENDMK
CāŠ—;
\magnification\magstephalf
\input macro.tex
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}
\baselineskip 14pt
\rm
\line{\sevenrm a10.tex[106,phy] \today\hfill}

\bigskip
\line{\bf Floating point numbers\hfill}

\vskip 1.5in

A desired result $x$ may be of four kinds:

\smallskip
\disleft 25pt:(1):
A representable number. In this case, the computed result is exactly the
desired result. Example on D3: $1.01-0.123=0.887$.

\smallskip
\disleft 25pt:(2):
Between two nonzero representable numbers. In this case, the computed
result may be either of the two. A~computer which always picks the closest
to the desired result is said to {\sl round\/}; one which always picks
the one closest to zero is said to {\sl truncate\/}. Most computers
systematically do one or the other, at least for $+\,$, $-\,$, $\ast\,$, and~$/$.

\smallskip
\disleft 25pt:(3):
A number of absolute value greater than MAXREAL. This situation is called
{\sl floating point overflow\/}.
Possible results are:

\smallskip
\display 45pt:(A):
Machine halts with an error message.

\smallskip
\display 45pt:(B):
Computed result is $\pm$ MAXREAL.

\smallskip
\disleft 25pt::
The user may be able to choose between these actions in advance. Choose~(A)
until you know what you are doing, at which point I~predict you will still
choose~(A). Usually floating point overflow results from a programming
error. Occasionally, rescaling will cure the problem. For example, if you
try to calculate the volume of the known universe in cubic \AA ngstrom
units  ($10↑{-8}$~cm), overflow is likely.

\smallskip
\disleft 25pt:(4):
A nonzero number of absolute value less than MINREAL. This situation is
{\sl floating point underflow\/}. As with~(3), two actions may occur:

\smallskip
\display 45pt:(A):
Machine halts with error message.

\smallskip
\display 45pt:(B):
Computed result is zero.

\smallskip
\display 25pt::
Given the choice, again choose (A). Again, floating point underflow, unless
you are trying to compute the volume of the electron using the diameter
of the universe as your unit of measurement, typically reflects a
programming error.


\bigskip
\parindent0pt
\copyright 1984 Robert W. Floyd

First draft July 19, 1984

\bye